package zoo.member.controller;


import java.util.HashMap;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import zoo.member.domain.MemberZipCommand;

import zoo.member.zipcode.dao.MemberZipDao;


@Controller
public class MemberZipCodeController {
	private static Log log = LogFactory.getLog(MemberZipCodeController .class);

	@Autowired
	private MemberZipDao memberzipDao;

	@RequestMapping(value="/main/zipForm.do")
	public ModelAndView process(@RequestParam(value="keyWord",defaultValue="없어")String keyWord)
									{

		if(log.isDebugEnabled()){	
			log.debug("keyWord:"+keyWord);
		}
		
		//map객체 생성
		HashMap<String,Object>map= new HashMap<String,Object>();
		map.put("keyWord", keyWord);
	
		List<MemberZipCommand> list = null;
		
			list=memberzipDao.list(map);
			
		//ModelAndView에 담아야함
		ModelAndView mav=new ModelAndView();
		mav.setViewName("user_popup/zipForm");
		mav.addObject("list",list);

		return mav;
		
	}
}
